import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

/***引入主系统操作***/
import showOutBGMoudle from './showOutBGMoudle.js'

import languageMoudle from './languageMoudle.js'

import mainModule from './mainModule.js'
import loginAndPermissionModule from './loginAndPermissionModule.js'

import scrollNavBgModule from './scrollNavBgModule.js'

/***将vuex存储localstorage处理***/
// import localStoragePlugin from './plugin/localStoragePlugin'
// let storageState = localStorage.getItem('hivescm.vuex.state')
let state = {
	...showOutBGMoudle.state,
	
	...languageMoudle.state,
	
    ...mainModule.state,
    ...loginAndPermissionModule.state,
    ...scrollNavBgModule.state
}
// if (storageState !== undefined && storageState !== null) {
//     state = JSON.parse(storageState)
// }


/***创建Vuex实例***/
const store = new Vuex.Store({
    // plugins: [localStoragePlugin],
    state: state,
    getters: {
    	...showOutBGMoudle.getters,
    	...languageMoudle.getters,
    	
        ...mainModule.getters,
        ...loginAndPermissionModule.getters,
        ...scrollNavBgModule.getters,
    },
    mutations: {
    	...showOutBGMoudle.mutations,
    	...languageMoudle.mutations,
    	
        ...mainModule.mutations,
        ...loginAndPermissionModule.mutations,

        ...scrollNavBgModule.mutations,
    },
    actions: {
    	...showOutBGMoudle.actions,
    	...languageMoudle.actions,
    	
        ...mainModule.actions,
        ...loginAndPermissionModule.actions
    }
})

export default store
